package com.waji.http;

import java.math.BigDecimal;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.avos.avoscloud.AVException;
import com.avos.avoscloud.AVGeoPoint;
import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.SaveCallback;
import com.waji.local.SharedPrefer;

public class SendState {
	
	public void saveState(final Context context) {
		String id = SharedPrefer.ReadUsername(context);
    	String state1 = SharedPrefer.ReadState(context);
    	
    	AVObject state = new AVObject("State");
		 state.put("id", id);
		 state.put("state", state1);
		 state.saveInBackground(new SaveCallback() {
			@Override
			public void done(AVException e) {
				if (e == null) {
					Toast.makeText(context, "保存状态成功", 1).show();
				} else {
					 Toast.makeText(context, "保存状态失败，请检查网络是否连接", 1).show();
				 }
			}
		});
	}
 }
